package com.kitty.game.rank.model.record;

import lombok.Getter;
import lombok.Setter;

/**道行排行榜记录*/
@Setter
@Getter
public class TaoRankRecord extends RankRecord {
    private String gid;
    private int tao;//道行
    private int taoPoint;//道行
    private String partyName;//帮派名
    private String name;//角色名称
    private short polar;//门派 相性
    private short roleIcon;//角色图标
    private short level;//等级

    public TaoRankRecord() {}

    public TaoRankRecord(String gid, int tao,int taoPoint, String partyName, String name, short polar, short roleIcon, short level) {
        this.gid = gid;
        this.tao = tao;
        this.taoPoint = taoPoint;
        this.partyName = partyName;
        this.name = name;
        this.polar = polar;
        this.roleIcon = roleIcon;
        this.level = level;
    }

    @Override
    public int compareTo(RankRecord o) {
        /**按道行从大到小排序*/
        TaoRankRecord other = (TaoRankRecord)o;
        if (tao != other.getTao()) {
            return tao > other.getTao() ? -1 : 1;
        }

        /**道行一样时，就按gid排序吧，保证不是同一个玩家就好了*/
        return gid.compareTo(other.getGid());
    }
}
